package com.jzj.controller;


import com.jzj.pojo.Book;
import com.jzj.service.impl.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;



@Controller
@ResponseBody
@RequestMapping("/book")
public class bookController {

    @Autowired
    private BookService bookService;



    @PutMapping()
    public int addBook(){
        return bookService.addBook();
    };


    public int delBook(){
        return bookService.delBook();
    };



    public int updateBook(){
        return  bookService.updateBook();
    };


    @GetMapping()
    public Object selectBook(){

        Object data = bookService.selectBook();
        return data;
    };



//    @GetMapping("bookName")
//    public Book selectBook(int id){
//        return bookService.selectOneBook(id);
//    };



}
